package modele.DAO;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import modele.ConnectionManager;

import com.mysql.jdbc.Connection;

public abstract class DAO<T> {
	
private Connection connect;
	
	DAO() {
		this.connect = ConnectionManager.getConnection();
	}
	
	public abstract T find(int id);
	public abstract void create(T obj);
	public abstract void update(T obj);
	public abstract void delete(T obj);
	protected PreparedStatement prepareStatement(String sql) throws SQLException {
		return connect.prepareStatement(sql);
	}

}
